#include <sstream>
#include <iomanip>
#include <iostream>
#include <algorithm>

#include "Airport.h"
#include "Plane.h"
#include "Utility.h"

class Entry
{
public:		
	std::string logLine() const;
	int year() const;
	int date() const;
	int index() const;
	std::string dateStr() const;
	int dayLandings() const;
	int nightLandings() const;
	double dayHours() const;
	double nightHours() const;
	int getAppr() const;
	double ifr() const;
	double gad() const;
	double cfi() const;
	double student() const;
	double dual() const;
	double pic() const;
	double sic() const;
	double safety() const;

	Entry();
	Entry(std::istringstream& entry_stream);
	~Entry();

private:
	const Plane* findPlane(const std::vector < Plane >& planes, std::string& call_number);
	const Airport* findAirport(const std::vector < Airport >& airports, std::string& name);

	std::string _entryLine;
	int _year;
	int _date;
	int _index;
	std::string _dateStr;
	int _dayLandings;
	int _nightLandings;
	int _approaches;
	double _dayHours;
	double _nightHours;
	double _ifr;
	double _gad;
	double _cfi;
	double _student;
	double _dual;
	double _pic;
	double _sic;
	double _safety;
	const Airport* _departure;
	const Airport* _destination;
	const Plane* _plane;
};
